<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>

</head>
<body>
    <div id = 'root'>
<h2>你好{{h1}}</h2>
<h2>嘻嘻哈哈{{h2}}</h2>
<button @click="showInfo">点击1</button>
<button @click="showInfo2($event , 66)">点击2</button>
<a href="www.baidu.com" @click.prevent="showInfo3" >congqian</a>

    </div>
    <script type="text/javascript">
      
       new Vue({
        el:'#root',
        data:{
            h1: '不好',
            h2: '哈哈'
        },
        methods:{
            showInfo(){
                alert("你好")
            },
            showInfo2(event , a){
                alert('一段誓言')
            },
            showInfo3(event , a){
                alert('一段誓言')
            }
        }
      })
    </script>
</body>
</html>